package cn.cmft.jc.transform.joiner;

import cn.cmft.jc.transform.parse.ChangeOptionMessage;

import java.util.List;

public class ImpactTaskResult {
    private String host;
    private int port;
    private String dbName;
    private String tableName;
    private Long tsMs;
    private String ddl;
    private List<ImpactTask> impactTasks;

    public ImpactTaskResult(ChangeOptionMessage changeOptionMessage, List<ImpactTask> impactTasks) {
        this.host = changeOptionMessage.getHost();
        this.port = changeOptionMessage.getPort();
        this.dbName = changeOptionMessage.getDatabase();
        this.tableName = changeOptionMessage.getTable();
        this.tsMs = changeOptionMessage.getTmMs();
        this.ddl = changeOptionMessage.getDdl();
        this.impactTasks = impactTasks;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }


    public String getDbName() {
        return dbName;
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Long getTsMs() {
        return tsMs;
    }

    public void setTsMs(Long tsMs) {
        this.tsMs = tsMs;
    }

    public String getDdl() {
        return ddl;
    }

    public void setDdl(String ddl) {
        this.ddl = ddl;
    }

    public List<ImpactTask> getImpactTasks() {
        return impactTasks;
    }

    public void setImpactTasks(List<ImpactTask> impactTasks) {
        this.impactTasks = impactTasks;
    }
    @Override
    public String toString() {
        return "{" +
                "host='" + host + '\'' + "\n" +
                "port=" + port + "\n" +
                "db_name='" + dbName + '\'' + "\n" +
                "table_name='" + tableName + '\'' + "\n" +
                "tsMs=" + tsMs + "\n" +
                "ddl='" + ddl + '\'' + "\n" +
                "impactTasks=" + impactTasks +
                "}";
    }
}
